home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5433 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  6.2 KB

  1. Path: mail2news.demon.co.uk!wildcard.demon.co.uk
  2. From: Cyber Surfer <cyber_surfer@wildcard.demon.co.uk>
  3. Newsgroups: comp.lang.lisp,comp.lang.c++,comp.lang.c,comp.lang.misc
  4. Subject: Re: GC & traditional allocators & textbooks
  5. Date: Sun, 04 Feb 96 17:40:23 GMT
  6. Organization: The Wildcard Killer Butterfly Breeding Ground
  7. Message-ID: <823455623snz@wildcard.demon.co.uk>
  8. References: <rvillDL4v3n.I8r@netcom.com> <822848307snz@wildcard.demon.co.uk> <4eu5l9$5m9@jive.cs.utexas.edu> <823365355snz@wildcard.demon.co.uk> <4f2ila$6p8@jive.cs.utexas.edu>
  9. Reply-To: cyber_surfer@wildcard.demon.co.uk
  10. X-NNTP-Posting-Host: wildcard.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.30
  12. X-Mail2News-Path: wildcard.demon.co.uk
  13.  
  14. In article <4f2ila$6p8@jive.cs.utexas.edu>
  15.            wilson@cs.utexas.edu "Paul Wilson" writes:
  16.  
  17. > >> >If you want to know about basic
  18. > >> >garbage collecting, I'd recommend a computer science book, as it'll
  19. > >> >probably be more up to date.
  20. > >> 
  21. > >> I have to disagree here.  I know of no textbooks with even a decent
  22. > >> discussion of garbage collection. [...]
  23. > >
  24. > >Was I refering to modern GC? I'm not sure. I don't know of any books
  25. > >on modern GC, but a book 20 years old seems to contain GC techniques
  26. > >that many C/C++ programmers are unaware of. Even if that's the best
  27. > >book on the subject, it could still enlighten a few programmers.
  28. > OK, agreed.  There are some fundamental algorithms that *are* in some
  29. > textbooks and should be better known.
  30.  
  31. I agree. I just suspect that those who think about these issues a lot
  32. under estimate how a programmer who is unfamiliar with even basic GC
  33. will react to the more advanced techniques. Disbelief is a common
  34. reaction, which I'm sure you've also seen. Arthur C Clarke's third
  35. law is worth quoting here, "Any sufficiently advanced technology is
  36. indistingishable from magic". Confront a programmer with some "magic"
  37. and they'll disbelieve it.
  38.  
  39. > On the other hand, even some of the textbooks that do discuss the
  40. > fundamental algorithms often propagate naive views about GC that are rather
  41. > damaging.  (Henry Baker, Hans Boehm, and I have all put a fair amount
  42. > of effort into trying to slow the spread of those myths on the net.)
  43.  
  44. And I hope you have a lot of success in your efforts, some of which I've
  45. witnessed here on UseNet. However, you first have to kill the idea that
  46. "successful GC" is magic. If it does work, then you'll have to offer
  47. examples of "real world" uses of GC before a typical programmer will be
  48. convinced. Most of the programmers I know are very suspicious of computer
  49. science, which doesn't help. There's no way they'll ever bother reading
  50. a paper about GC. On the other hand, they probably won't have read any
  51. books on the subject, either.
  52.  
  53. This only leaves the word of other programmers, and the masses of code
  54. that apparently has been written _without_ the use of GC. As I've said,
  55. C/C++ programers see the cost of everything and the value of nothing.
  56. Please note that I'm also a C/C++ programmers myself, and I also make
  57. that mistake from time to time. Some languages let you focus on the
  58. very small picture, instead of the big picture, where GC can help.
  59.  
  60. > This is also true of traditional allocators.  The history of allocator
  61. > research has been a big mess---the literature is a bit of a disaster
  62. > area---and the textbooks reflect this.  The analyses in the books are 
  63. > shallow and largely wrong.  (This is less attributable to the textbooks
  64. > authors than the weak discussions of GC.  It's not their fault that they
  65. > can't summarize the gist of the literature and get it right, because
  66. > the literature in general is disorganized, inconsistent, and often wrong.)
  67.  
  68. I won't argue with that! ;-) I'd love to see a good summary.
  69.  
  70. > One of the problems in the area of traditional memory allocators is that
  71. > people have taken one particular textbook far too seriously---Volume 1
  72. > of Knuth's _The_Art_of_Computer_Programming_.  It was written in 1968,
  73. > and some of it has turned out to be less than helpful.  It's still the
  74. > standard reference, though, and other textbook writers often regurgitate
  75. > its discussion of memory allocators.  Implementors often look at it and
  76. > go and implement things that have been known to be bad since the early
  77. > 1970's.  (Knuth is still tremendously influential in allocator work,
  78. > despite the fact that he doesn't appear to have written anything about it
  79. > in over 25 years.  This is not Knuth's fault, of course---inertia makes
  80. > the world go 'round.)
  81.  
  82. I also have that book, and the other 3 volumes. However, they didn't
  83. stop me from writting and using a GC. If I wanted to write a floating
  84. point package (very unlikely, even 10 years ago), then I might turn
  85. to Knuth, but not for anything like memory management.
  86.  
  87. Perhaps I've been brainwashed by those evil people are Xerox PARC,
  88. when I read the August 1981 issue of Byte. ;-) I doubt it. I just
  89. don't have a blind spot that prevents me from seeing problems for
  90. which a GC can help. As you said, Knuth's book is very old. In it
  91. he refers to decimal computers! <ahem> Very dated, now.
  92.  
  93. > "Modified First Fit" with the roving pointer is the clearest example.  It
  94. > was a bad idea, and it was quickly shown to be bad, but some other textbook
  95. > writers keep mindlessly cribbing from Knuth, and even some implementors still
  96. > use it.
  97.  
  98. Is it really worse than Best Fit? I've wondered about that ever
  99. since first read that book. You seem like a good person to ask. ;)
  100.  
  101. > Obligatory positive comment:  the best textbook discussion of allocators
  102. > that I know of is Tim Standish's in _Data_Structure_Techniques_.  He doesn't
  103. > recognize the near-universal methodological problems with allocator studies,
  104. > but he's unique in recognizing the basic data structure and algorithm issues
  105. > in implementing allocators.
  106.  
  107. I'll see if I can find that book. Thanks.
  108.  
  109. > This site also has our big survey on memory allocators from IWMM '95, which
  110. > I hope will influence future textbooks.  It talks about empirical methodology
  111. > as well as giving a fairly exhaustive treatment of implementation techniques.
  112.  
  113. I FTP'd it a week or two ago. I intend to read it, as soon as I
  114. get a (binary) copy of Ghostscript for NT. Thanks.
  115. -- 
  116. <URL:http://www.demon.co.uk/community/index.html>
  117. <URL:http://www.enrapture.com/cybes/namaste.html>
  118. Po-Yeh-Pao-Lo-Mi | "You can never browse enough."
  119.